package heven.holt.wan.android.di

import dagger.Module
import dagger.Provides
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import heven.holt.wan.android.api.*
import heven.holt.wan.android.repository.*
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
    @Provides
    @Singleton
    fun provideWanConfigRepository(apiWanHomeServer: ApiWanHomeServer): WanConfigRepository =
        WanConfigRepository(apiWanHomeServer)

    @Provides
    @Singleton
    fun provideWanArticleRepository(apiWanArticleServer: ApiWanArticleServer): WanArticleRepository =
        WanArticleRepository(apiWanArticleServer)

    @Provides
    @Singleton
    fun provideWanUserRepository(apiWanUserServer: ApiWanUserServer): WanUserRepository =
        WanUserRepository(apiWanUserServer)

    @Provides
    @Singleton
    fun provideWanCoinRepository(apiWanCoinServer: ApiWanCoinServer): WanCoinRepository =
        WanCoinRepository(apiWanCoinServer)

    @Provides
    @Singleton
    fun provideWanNavigationRepository(apiWanNavigationServer: ApiWanNavigationServer): WanNavigationRepository =
        WanNavigationRepository(apiWanNavigationServer)

    @Provides
    @Singleton
    fun provideWanProjectRepository(apiWanProjectServer: ApiWanProjectServer): WanProjectRepository =
        WanProjectRepository(apiWanProjectServer)

    @Provides
    @Singleton
    fun provideWanQaRepository(apiWanQaServer: ApiWanQaServer): WanQaRepository =
        WanQaRepository(apiWanQaServer)
}

@EntryPoint
@InstallIn(SingletonComponent::class)
interface WanUserRepositoryProviderEntryPoint {
    fun wanUserRepository(): WanUserRepository
}